<?php
namespace app\admin\validate;

use think\Validate;
use think\Db;

class SystemConfig extends Validate{
    //验证规则
    protected $rule = [
        'ch_name'  => 'require',
        'en_name' => 'require|unique:SystemConfig',
    ];

    //提示信息
    protected $message = [
        'ch_name.require'  => '中文名称必填！',
        'en_name.require' => '英文名称必填！',
        'en_name.unique' => '英文名称不能重复！',
    ];

    //验证场景
    protected $scene = [
        'add_config'=>[
            'ch_name',
            'en_name'
        ],
        'edit_config'=>[
            'ch_name',
            'en_name'
        ],
    ];
}